import Cookies from "js-cookie"

export const getApiURl = function () {
    return import.meta.env.VITE_API_URL
}

export const setToken = function (token: string) {
    Cookies.set("access_token", token, {
        expires: 360
    })
}

export const setUserId = function (userId: string) {
    localStorage.setItem("userId", userId)
}

export const getUserId = function () {
    return localStorage.getItem("userId")
}

export const getToken = function () {
    return Cookies.get("access_token")
}

export const removeToken = function () {
    Cookies.remove("access_token", {
        expires: 360
    })
    localStorage.removeItem("userId")
}

